package com.yi.wood.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * Created by moyi on 2019/1/25 16:30
 *
 * @author moyi
 * 分类
 */
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "classification")
@Data
public class Classification extends BaseEntity {

    /**
     * 状态标记，默认1： 有效，0：删除
     */
    @Column(name = "status")
    private Integer status = 1;

    /**
     * 分类级别，eg：一级分类，二级分类
     * 不能为空
     */
    @Column(name = "level", nullable = false)
    private Integer level;

    /**
     * 分类名称
     */
    @Column(name = "title", nullable = false)
    private String title;
    /**
     * 排序
     */
    @Column(name = "sort", nullable = false)
    private Integer sort;
    /**
     * 上级ID
     */
    @Column(name = "parent_id", nullable = false)
    private Long parentId;
    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;
    /**
     * 路径
     */
    @Column(name = "path")
    private String path;
    /**
     * 分类图标
     */
    @Column(name = "icon")
    private String icon;
    /**
     * 分类类型，1-后台侧边菜单，2-后台顶部菜单，3-前端分类菜单
     */
    @Column(name = "type")
    private Integer type;
}
